import type { R } from '@/api/model/resultModel';
import type { XhljActivityDiscussionForm, XhljActivityDiscussionQuery, XhljActivityDiscussionVo } from '@/api/xhlj/model/activityDiscussionModel';
import { request } from '@/utils/request';

// 查询会议交流列表
export function listActivityDiscussion(query?: XhljActivityDiscussionQuery) {
  return request.get<R<Array<XhljActivityDiscussionVo>>>({
    url: '/xhlj/activityDiscussion/list',
    params: query,
  });
}

// 查询会议交流详细
export function getActivityDiscussion(discussionId: number) {
  return request.get<R<XhljActivityDiscussionVo>>({
    url: `/xhlj/activityDiscussion/${discussionId}`,
  });
}

// 新增会议交流
export function addActivityDiscussion(data: XhljActivityDiscussionForm) {
  return request.post<R<void>>({
    url: '/xhlj/activityDiscussion',
    data,
  });
}

// 修改会议交流
export function updateActivityDiscussion(data: XhljActivityDiscussionForm) {
  return request.put<R<void>>({
    url: '/xhlj/activityDiscussion',
    data,
  });
}

// 删除会议交流
export function delActivityDiscussion(discussionIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/activityDiscussion/${discussionIds}`,
  });
}
